package cn.wolfcode.p2p.web.controller;

import cn.wolfcode.p2p.base.service.IAccountService;
import cn.wolfcode.p2p.base.service.IUserInfoService;
import cn.wolfcode.p2p.web.util.RequiredLogin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 前台:个人中心
 */
@Controller
public class PersonalController {

    @Autowired
    private IAccountService accountService;
    @Autowired
    private IUserInfoService userInfoService;

    @RequestMapping("/personal")
    @RequiredLogin
    public String personal(Model model){
        model.addAttribute("account",accountService.getCurrent());
        model.addAttribute("userInfo",userInfoService.getCurrent());
        return "personal";
    }

}
